﻿using System;
namespace Producers.Rr.Xtee.Riik.Ee.Producer.Rr {
    
    
    public class SynnitoendiFormaat : global::Xtee.Core.Schema.XsdString {
        
        public const string JPG = "jpg";
        
        public const string JPEG = "jpeg";
        
        public const string BMP = "bmp";
        
        public const string TIF = "tif";
        
        public const string PDF = "pdf";
        
        public const string GIF = "gif";
        
        public const string DDOC = "ddoc";
        
        public SynnitoendiFormaat(string value) : 
                base(value) {
            this.Validate();
            string annot = null;
            if (Value == "jpg") {
                annot = "jpg";
            }
            if (Value == "jpeg") {
                annot = "jpeg";
            }
            if (Value == "bmp") {
                annot = "bmp";
            }
            if (Value == "tif") {
                annot = "tif";
            }
            if (Value == "pdf") {
                annot = "pdf";
            }
            if (Value == "gif") {
                annot = "gif";
            }
            if (Value == "ddoc") {
                annot = "ddoc";
            }
            if (annot!=null) {
                this._annotation = annot;
            }
            else {
                throw new global::Xtee.Core.Types.XteeSimpleTypeValidationException(string.Format("Enumeration on [{0}] does not allow value : [{1}] ", this.GetType().Name,Value.ToString()));;
            }
        }
        
        public SynnitoendiFormaat() : 
                base(string.Empty) {
        }
        
        public static bool TryParse(string value, out global::Producers.Rr.Xtee.Riik.Ee.Producer.Rr.SynnitoendiFormaat result) {
            try {
                result = new global::Producers.Rr.Xtee.Riik.Ee.Producer.Rr.SynnitoendiFormaat(value);
                return true;
            }
            catch (System.Exception ) {
                result = null;
                return false;
            }
        }
        
        public static implicit operator String (SynnitoendiFormaat value) {
            return value.Value;
        }
        
        public static implicit operator SynnitoendiFormaat (string value) {
            if (value==null) {
                return null;
            }
            return new SynnitoendiFormaat(value);
        }
    }
}
